-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-53802][SDP] Support string values for user-specified schema in SDP tables #52517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
50b839e
to
cb8ba44
Compare
assert(graph.tables.size == 1) | ||
|
||
val table = graph.table(graphIdentifier("table_with_string_schema")) | ||
assert(table.specifiedSchema.isDefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: shall we simply compare table.specifiedSchema
with an expected schema (for example, StructType.fromDDL(id LONG, name STRING)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oo yeah was not aware of that
optional spark.connect.DataType schema = 7; | ||
oneof schema { | ||
spark.connect.DataType schema_data_type = 7; | ||
string schema_string = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since Spark 4.1 is not offically released. I wonder if we can change the sequence numbers here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point – fixing
Thanks, merging to master |
What changes were proposed in this pull request?
When defining a streaming table or materialized view, enable passing a string to its schema, in addition to a StructType. This mimics the flexibility of the
DataFrameReader
schema arg.E.g.
Why are the changes needed?
For flexibility and consistency with similar args.
Does this PR introduce any user-facing change?
Makes changes to unreleased protos.
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?